package com.wjw.single.single01;

/**
 * 单一职责原则
 *
 * @author ikaros
 * @date 2024/7/7 0:15
 * @see <a href="ikaros@qq.com">mailTo: ikaros@qq.com</a>
 */
public class SingleResponsibility {

    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("自行车");
        vehicle.run("游轮");
        vehicle.run("客机");
    }
}

/**
 * 交通工具类
 */
class Vehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + "在公路上行驶");
    }
}
